<?php


class ProductsFactory
{
    public function create($type){
        switch ($type){
            case 'A':
                return new ProductA();
            case 'B':
                return new ProductB();
            default:
                return null;
        }
    }
}